 function setCookie(key,value,date,path,domain,secure){
	 	var str="";
	 	if (key&&value) {
	 		str+=encodeURIComponent(key)+"="+encodeURIComponent(value)+";"
	 	}
	 	if (date instanceof Date) {
	 		str+="expires="+date+";"
	 	}
	 	if (path) {
	 		str+="path"+path+";"
	 	}
	 	if (domain) {
	 		str+="domain"+domain+";"
	 	}if (secure=="secure"){
	 		str+="secure"
	 	}
	 	document.cookie=str;
	 }
	 function getCookieAll(){
	 	var obj={};
	 	var str=document.cookie;
	 	if (str.indexOf(";")!=-1) {
	 		var arr1=str.split(";");
	 		for (var i=0;i<arr1.length;i++) {
	 			var arr2=arr1[i].split("=");
	 			obj[decodeURIComponent(arr2[0].trim())]=decodeURIComponent(arr2[1].trim());
	 		}
	 	}else{
	 		if (str.indexOf("=")!=-1) {
	 			arr1=str.split("=");
	 			obj[decodeURIComponent(arr1[0].trim())]=decodeURIComponent(arr1[1].trim());
	 		}
	 	}
	 	return obj;
	 }
	 function getCookieValueByKey(key){
	 	var obj=getCookieAll();
		return obj[key];
	 }